#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from dict.mongo import *
from dict.setting import *

reload(sys)
sys.setdefaultencoding( "utf-8" )
db = MongoDb()
db.clear()
for k in dictitems:
    sort = k
    items = dictitems[k]
    for p in items:
        item = items[p]
        for d in item:
            o={}
            o['sort'] = k
            o['name'] = p
            o['value'] = d
            db.save(o)
        # item['sort'] = k
        # item['name'] = p
        # if not item.has_key('text'):
        #    item['text'] = p
        # if not item.has_key('isShow'):
        #     item['isShow'] = False
        # if not item.has_key('filterType'):
        #     item['filterType'] = 1
        #db.save(item)